//- Copyright (c) 2016 Lucky Byte, Inc.
extends ../../layout

block content
  form.ui.form.attached.segment.main(method="post" action="/p2/fund/recharge")
    input(type="hidden" name="serial" value="#{record.serial || ''}")
    input(type="hidden" name="uuid" value="#{record.uuid || ''}")

    h4.ui.dividing.header.unit
      i.caret.down.icon.link.grey.accordion
      | 充值信息

    .fields
      .field.eight.wide
        label 资金池代号: 
        .ui.input
          input(type="text" name="name" placeholder="必填"
            readonly="readonly" value="#{record.name || ''}")
      .field.eight.wide
        label 代理商名称: 
        .ui.input
          input(type="text" name="name" placeholder="必填"
            readonly="readonly" value="#{record.agent || ''}")
    .fields
      .field.four.wide
        label 资金总额: 
        .ui.input.left.icon
          i.icon.yen
          input(type="text" name="name" placeholder="必填" readonly="readonly"
            value="#{record.fund_total ? fmtamt(record.fund_total) : ''}")
      .field.four.wide
        label 当前余额: 
        .ui.input.left.icon
          i.icon.yen
          input(type="text" name="name" placeholder="必填" readonly="readonly"
            value="#{record.fund_remains ? fmtamt(record.fund_remains) : ''}")
      .field.eight.wide.required
        label 充值金额: 
        .ui.input.left.icon
          i.icon.yen
          input(type="text" name="recharge" placeholder="必填，可以为负数")

    .ui.buttons(style="margin-top:40px;")
      button.ui.yellow.button#cancel(type="button"
        onclick="window.location = '/p2/fund'") 取 消

      .or

      if page_perms.new
        button.ui.green.button#ok(type="submit") 确 定
      else
        button.ui.green.button.disabled#ok(type="submit")
          i.icon.ban(style="margin-top:1px; margin-right:2px;")
          | 确 定
